/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.eb.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.kaaction.common.persistence.DataEntity;

/**
 * 订单与商品Entity
 * @author zengbiao
 * @version 2017-04-19
 */
public class OrderProduct extends DataEntity<OrderProduct> {
	
	private static final long serialVersionUID = 1L;
	private Order order;		// order_id
	private Product product;		// product_id
	private String sourceType;		// source_type
	private String sourceId;		// source_id
	private Integer sourceLimit;		// source_limit
	private String productImage;		// product_image
	private Integer productQuantity;		// product_quantity
	private Double productMarketPrice;		// 市场价
	private Double productPrice;		// 实际单价
	private Integer productRank;		// product_rank
	private Double productTotalPrice;		// product_total_price
	private Double customerPaidPrice;		// customer_paid_price
	private Integer productPerWeight;		// product_per_weight
	private Double productTotalWeight;		// product_total_weight
	private String productSize;				//商品尺寸
	private String status;		// 有效
	
	public OrderProduct() {
		super();
	}

	public OrderProduct(String id){
		super(id);
	}

	@NotNull(message="订单不能为空")
	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}
	
	@NotNull(message="商品不能为空")
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}
	
	@Length(min=0, max=64, message="source_type长度必须介于 0 和 64 之间")
	public String getSourceType() {
		return sourceType;
	}

	public void setSourceType(String sourceType) {
		this.sourceType = sourceType;
	}
	
	@Length(min=0, max=64, message="source_id长度必须介于 0 和 64 之间")
	public String getSourceId() {
		return sourceId;
	}

	public void setSourceId(String sourceId) {
		this.sourceId = sourceId;
	}
	
	public Integer getSourceLimit() {
		return sourceLimit;
	}

	public void setSourceLimit(Integer sourceLimit) {
		this.sourceLimit = sourceLimit;
	}
	
	@Length(min=0, max=2000, message="product_image长度必须介于 0 和 2000 之间")
	public String getProductImage() {
		return productImage;
	}

	public void setProductImage(String productImage) {
		this.productImage = productImage;
	}
	
	@NotNull(message="product_quantity不能为空")
	public Integer getProductQuantity() {
		return productQuantity;
	}

	public void setProductQuantity(Integer productQuantity) {
		this.productQuantity = productQuantity;
	}
	
	public Double getProductMarketPrice() {
		return productMarketPrice;
	}

	public void setProductMarketPrice(Double productMarketPrice) {
		this.productMarketPrice = productMarketPrice;
	}
	
	@NotNull(message="实际单价不能为空")
	public Double getProductPrice() {
		return productPrice;
	}

	public void setProductPrice(Double productPrice) {
		this.productPrice = productPrice;
	}
	
	public String getProductSize() {
		return productSize;
	}

	public void setProductSize(String productSize) {
		this.productSize = productSize;
	}

	public Integer getProductRank() {
		return productRank;
	}

	public void setProductRank(Integer productRank) {
		this.productRank = productRank;
	}
	
	@NotNull(message="product_total_price不能为空")
	public Double getProductTotalPrice() {
		return productTotalPrice;
	}

	public void setProductTotalPrice(Double productTotalPrice) {
		this.productTotalPrice = productTotalPrice;
	}
	
	public Double getCustomerPaidPrice() {
		return customerPaidPrice;
	}

	public void setCustomerPaidPrice(Double customerPaidPrice) {
		this.customerPaidPrice = customerPaidPrice;
	}
	
	public Integer getProductPerWeight() {
		return productPerWeight;
	}

	public void setProductPerWeight(Integer productPerWeight) {
		this.productPerWeight = productPerWeight;
	}
	
	public Double getProductTotalWeight() {
		return productTotalWeight;
	}

	public void setProductTotalWeight(Double productTotalWeight) {
		this.productTotalWeight = productTotalWeight;
	}
	
	@Length(min=1, max=1, message="有效长度必须介于 1 和 1 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
}